/******************************************************************************

  Copyright (C), 2012-2016, ZHANGYA

 ******************************************************************************
  File Name     : deal.h
  Version       : Initial Draft
  Author        : zhangya
  Created       : 2024/5/20
  Last Modified :
  Description   : deal.h
  Function List :
  History       :
  1.Date        : 2024/5/20
    Author      : zhangya
    Modification: Created file

******************************************************************************/

#ifndef _DEAL_H_
#define _DEAL_H_

#include "main.h"
#include "uaprot.h"

#ifdef __cplusplus
extern "c" {
#endif

/*--------------------------------------------------------------------*
 * $external variables                           *
 *--------------------------------------------------------------------*/

/*--------------------------------------------------------------------*
 * $external routine prototypes                  *
 *--------------------------------------------------------------------*/
#define DEAL_DATA_BUF_SIZE			(32)

typedef struct deal_data_str{
	uint8_t msgid;
	uint8_t bctl;
	uint8_t port;
	uint8_t dlen;
	uint8_t buff[DEAL_DATA_BUF_SIZE];
}deal_data_t;

typedef struct deal_fun_str{
	void (*get_data_cb)(const pack_para_t * para);
}deal_fun_t;
/*--------------------------------------------------------------------*
 * $internal routine prototypes                  *
 *--------------------------------------------------------------------*/

/*--------------------------------------------------------------------*
 * $project-wide global variables                *
 *--------------------------------------------------------------------*/

/*--------------------------------------------------------------------*
 * $module-wide global variables                 *
 *--------------------------------------------------------------------*/

/*--------------------------------------------------------------------*
 * $constants                                    *
 *--------------------------------------------------------------------*/

/*--------------------------------------------------------------------*
 * $macros                                       *
 *--------------------------------------------------------------------*/

/*--------------------------------------------------------------------*
 * $routines' implementations                    *
 *--------------------------------------------------------------------*/

void deal_init(const deal_fun_t * fun);
bool deal_add_data(const deal_data_t * data, bool confirm);
void deal_handle(void);


#ifdef __cplusplus
}
#endif

#endif  //#ifndef _DEAL_H_

